#include <iostream>
#include <string>
#include "Vehicle.h"
#include "Car.h"
#include "Ship.h"


using namespace std;

int main( void )
{
	Vehicle *vehicle[5];

	for ( int i = 0; i < 5; ++i )
	{
		int choice;
		char buffer[256];

		while ( true )
		{
			cout << "1. Car" << endl;
			cout << "2. Ship" << endl;

			cin >> choice;

			switch( choice )
			{
			case 1:
				cout << i << " Enter Driver Name: ";
				cin >> buffer;
				vehicle[i] = new Car( "car", 0, 0, buffer );
				break;
			case 2:
				cout << i << " Enter Captain Name: ";
				cin >> buffer;
				vehicle[i] = new Ship( "Ship", 0, 0, buffer );
				break;
			default:
				cout << "Try Again." << endl;
			}

			if ( choice == 1 || choice == 2 )
				break;
		}
	}

	for ( int i = 0; i < 5; ++i )
	{
		vehicle[i]->Show();
		cout << endl;
	}
    

	return 0;
	system("pause");
}